#ifndef __CAN_H
#define __CAN_H
#include "config.h"

#define ID_MODE_STANDARD (0x0U)
#define ID_MODE_EXTENDED (0x1U)

extern volatile uint32_t gInterruptLine0Status;
extern volatile bool gServiceInt;
extern DL_MCAN_RxBufElement rxMsg;
extern DL_MCAN_TxBufElement txMsg;
extern DL_MCAN_RxFIFOStatus rxFS;
extern DL_MCAN_TxFIFOStatus txFS;
extern DL_MCAN_TxBufElement i_am_alive_msg;
void can_build_standard_frame(DL_MCAN_TxBufElement *elem, uint16_t stdId, const uint8_t *payload, uint8_t length);
extern bool can_rx_fifo_has_data(DL_MCAN_RX_FIFO_NUM fifoNum);
extern uint32_t can_rx_fifo_fill_level(DL_MCAN_RX_FIFO_NUM fifoNum);
extern bool can_rx_fifo_pop(DL_MCAN_RX_FIFO_NUM fifoNum, DL_MCAN_RxBufElement *elem);
extern uint32_t can_tx_fifo_free_level(void);
extern bool can_tx_fifo_push(const DL_MCAN_TxBufElement *elem);

extern void createTestFrame(void);

#endif